#include<iostream>
#include<queue>
#include<vector>

using namespace std;

priority_queue<int, vector<int>, less<int>>q;

int main()
{
	int n, m, k; cin >> n >> m >> k;
	for (int i = 1; i <= n; i++)
	{
		int b; cin >> b;
		q.push(b);
		if (q.size() > k)
			q.pop();
	}
	while (m--)
	{
		int x; cin >> x;
		int number = 0;
		if (x == 1)
		{
			int y; cin >> y;
			q.push(y);
			if (q.size() > k)
				q.pop();
		}
		else if (x == 2)
		{
			if (q.size() == k)
				cout << q.top() << endl;
			else
				cout << -1 << endl;
		}
	}
	return 0;
}
